var mapIds = [993170100];
var 准备地图 = 993170000;

function init() {}

function setup(c, a) {
    em.setProperty("state", 1);
    em.setProperty("leader", "true");
    var c = em.newInstance("荣耀活动_激战中的乱港");
    for (var b = 0; b < mapIds.length; b++) {
        var d = c.setInstanceMap(mapIds[b]);
        d.resetFully();
        d.killAllMonsters(true)
    }
    return c
}

function 通关(a) {
    a.getPlayers().forEach(function (d) {
        var c = a.getNumberProperty("kill");
        var b = a.getNumberProperty("point");
        if (c > 150) {
            d.getAPI().gainGloryEventPoint(b);
            b *= 2
        }
        if (c > 300) {
            d.getAPI().gainGloryEventPoint(b);
            b *= 2
        }
        d.getAPI().gloryWildWater(3, [c, b])
    })
}

function 刷怪(a) {
    if (a.getPlayers().size() == 0) {
        return
    }
    a.getPlayers().forEach(function (d) {
        var b = d.getPosition().x;
        d.getMap().killMonsterInRange(0, -200, b - 1200, 500, false);
        var c = a.getNumberProperty("index");
        for (; c < mobs.length; c++) {
            if (mobs[c][1] > b + 3000) {
                break
            }
            d.getAPI().spawnMob(mobs[c][0], 1, mobs[c][1], mobs[c][2])
        }
        a.setProperty("index", c)
    });
    a.schedule("刷怪", 3 * 1000)
}

function onPlayerRegistered(b, a) {
    a.setReviveCount(-100);
    var c = b.getMapInstance(0);
    a.changeMap(c, c.getPortal(0));
    b.setProperty("weapon", 0);
    b.setProperty("lv", 1);
    b.setProperty("ammo", 0)
}

function onPlayerRevived(b, a) {
    return false
}

function onMapChanged(c, b, a) {
    em.setProperty("kill", "0");
    em.setProperty("level", "0");
    em.setProperty("clear", "0");
    em.setProperty("curMap", a);
    c.setProperty("index", 0);
    if (mapIds.indexOf(a) < 0) {
        on玩家退场(c, b, false);
        return
    }
}

function onPlayerDisconnected(b, a) {
    on玩家退场(b, a, false);
    return 0
}

function onMonsterDamaged(b, a, d, e, c) {}

function onTimeOut(a) {
    a.getPlayers().forEach(function (b) {
        on玩家退场(a, b, true)
    })
}

function onMonsterKilled(b, d, c) {
    b.setProperty("kill", b.getNumberProperty("kill") + 1);
    switch (d) {
        case 9833631:
            var a = 10;
            break;
        case 9833632:
            var a = 20;
            break;
        case 9833633:
            var a = 40;
            break;
        case 9833634:
            var a = 80;
            break
    }
    player.getAPI().gainGloryEventPoint(a);
    b.setProperty("point", b.getNumberProperty("point") + a)
}

function onPartyDisbanded(a) {}

function onPlayerKilled(b, a) {}
var setupTask;

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
}

function initProp(a, b) {
    if (em.getProperty(a) == null) {
        em.setProperty(a, b)
    }
}

function initPropArray(a, d, c, e) {
    for (var b = c; b <= e; b++) {
        if (em.getProperty(a + "_" + b) == null) {
            em.setProperty(a + "_" + b, d)
        }
    }
}

function on玩家退场(c, b, a) {
    c.disposeIfPlayerBelow(a ? 999 : 0, 准备地图);
    em.getProperties().clear();
    em.setProperty("state", 0);
    em.setProperty("leader", "true");
    c.unregisterPlayer(b)
}

function onItemPickedUp(b, a, c) {}
var mobs = [
    [9833631, 800, 36],
    [9833631, 650, 36],
    [9833631, 720, 36],
    [9833631, 870, 36],
    [9833631, 890, -97],
    [9833631, 940, 36],
    [9833631, 1820, -194],
    [9833631, 2125, 34],
    [9833631, 2270, -104],
    [9833632, 2250, 154],
    [9833631, 1580, -53],
    [9833631, 1760, 154],
    [9833631, 1750, -194],
    [9833631, 2110, 154],
    [9833631, 2530, 154],
    [9833632, 2320, 154],
    [9833631, 4040, 148],
    [9833632, 3640, 51],
    [9833631, 4170, -54],
    [9833632, 4030, -54],
    [9833631, 3570, 51],
    [9833631, 3710, 51],
    [9833631, 4100, -54],
    [9833631, 3960, -54],
    [9833631, 3900, 148],
    [9833631, 4450, -6],
    [9833631, 4710, 148],
    [9833631, 4490, -184],
    [9833632, 4660, -5],
    [9833632, 4360, 148],
    [9833631, 5680, -149],
    [9833632, 5760, 17],
    [9833632, 6320, 12],
    [9833632, 5900, 17],
    [9833631, 5690, 17],
    [9833631, 5540, -149],
    [9833631, 5750, -149],
    [9833631, 6530, 12],
    [9833631, 6620, -151],
    [9833632, 6670, 12],
    [9833631, 6880, 12],
    [9833631, 6690, -151],
    [9833633, 6760, -151],
    [9833631, 6550, -151],
    [9833631, 6480, -152],
    [9833631, 7670, -29],
    [9833631, 8270, -66],
    [9833631, 7650, -188],
    [9833632, 8170, -199],
    [9833631, 7790, -187],
    [9833631, 8340, -66],
    [9833631, 8410, -66],
    [9833632, 8240, -198],
    [9833633, 8310, -198],
    [9833631, 8380, -198],
    [9833632, 8200, -66],
    [9833631, 8970, -12],
    [9833632, 8800, -169],
    [9833631, 8910, -13],
    [9833631, 8730, -169],
    [9833631, 9110, -12],
    [9833631, 8480, -66],
    [9833633, 9040, -12],
    [9833631, 8870, -169],
    [9833632, 10230, -206],
    [9833631, 9870, 60],
    [9833631, 10010, 60],
    [9833633, 10230, 102],
    [9833631, 10440, 103],
    [9833631, 9730, -180],
    [9833632, 10300, -205],
    [9833631, 10300, 103],
    [9833631, 9730, 59],
    [9833631, 10230, -66],
    [9833633, 10010, -179],
    [9833632, 9800, -179],
    [9833631, 10370, -205],
    [9833631, 10300, -65],
    [9833631, 9940, -179],
    [9833631, 10730, -184],
    [9833631, 10510, -65],
    [9833632, 10730, 49],
    [9833631, 10510, 103],
    [9833631, 10940, 50],
    [9833631, 11010, 50],
    [9833631, 12400, 20],
    [9833632, 12320, -162],
    [9833631, 12110, -162],
    [9833631, 12180, -162],
    [9833632, 12120, 20],
    [9833631, 12370, -162],
    [9833632, 12040, -163],
    [9833631, 12050, 19],
    [9833633, 12470, 20],
    [9833632, 12540, 20],
    [9833631, 12680, 20],
    [9833631, 12610, 20],
    [9833633, 12880, -91],
    [9833631, 12900, 54],
    [9833631, 12970, 55],
    [9833631, 13110, 55],
    [9833632, 13180, 55],
    [9833631, 13040, 55],
    [9833631, 12670, -92],
    [9833631, 12740, -91],
    [9833631, 12770, -221],
    [9833632, 14410, -165],
    [9833632, 14200, -165],
    [9833632, 13990, -18],
    [9833631, 14060, -18],
    [9833633, 14340, -165],
    [9833631, 14200, -18],
    [9833631, 14130, -18],
    [9833632, 14270, -165],
    [9833631, 14500, 38],
    [9833631, 15280, 67],
    [9833631, 15090, -82],
    [9833631, 15230, -82],
    [9833631, 14920, 38],
    [9833631, 15350, 67],
    [9833631, 14780, 38],
    [9833631, 15420, 67],
    [9833631, 14930, -219],
    [9833631, 14950, -82],
    [9833633, 15000, -219],
    [9833631, 15160, -82],
    [9833632, 14650, -218],
    [9833631, 14710, 38],
    [9833631, 14790, -219],
    [9833631, 16490, 95],
    [9833632, 16210, 95],
    [9833631, 16260, -60],
    [9833631, 16000, 95],
    [9833631, 16400, -201],
    [9833632, 16190, -201],
    [9833631, 16400, -60],
    [9833632, 16280, 95],
    [9833632, 16550, -184],
    [9833631, 16120, -201],
    [9833631, 16140, 95],
    [9833631, 16330, -201],
    [9833631, 16050, -59],
    [9833631, 16560, 95],
    [9833631, 17300, -179],
    [9833632, 17160, -179],
    [9833631, 16620, -184],
    [9833633, 16970, 31],
    [9833631, 17020, -179],
    [9833631, 17040, 37],
    [9833631, 16830, -65],
    [9833633, 16700, 95],
    [9833631, 16690, -163],
    [9833631, 17090, -179],
    [9833631, 18450, 101],
    [9833631, 17760, -39],
    [9833631, 17690, -39],
    [9833631, 18160, -193],
    [9833631, 17970, -39],
    [9833631, 17880, -193],
    [9833632, 18100, 101],
    [9833631, 17830, -39],
    [9833632, 17900, -39],
    [9833633, 18450, -187],
    [9833631, 18590, -188],
    [9833631, 18660, -188],
    [9833631, 18660, -33],
    [9833632, 18240, 101],
    [9833657, 18457, 38],
    [9833631, 18520, -32],
    [9833632, 18380, 101],
    [9833631, 18090, -193],
    [9833631, 17810, -192],
    [9833633, 18980, 100],
    [9833631, 18910, 100],
    [9833632, 18730, -33],
    [9833631, 18730, -188],
    [9833631, 19200, -131],
    [9833631, 19060, -131],
    [9833633, 19130, -131],
    [9833631, 19760, -72],
    [9833633, 19990, -214],
    [9833631, 19920, 90],
    [9833632, 19850, 90],
    [9833631, 19920, -214],
    [9833631, 19850, -214],
    [9833631, 19900, -72],
    [9833631, 19990, 90],
    [9833632, 20530, 91],
    [9833633, 20320, 92],
    [9833631, 20460, -214],
    [9833632, 20530, -214],
    [9833631, 20250, -72],
    [9833631, 20460, 91],
    [9833632, 20600, 91],
    [9833631, 20670, -214],
    [9833631, 20040, -72],
    [9833631, 20390, -214],
    [9833632, 20320, -213],
    [9833631, 20060, 90],
    [9833632, 20670, 91],
    [9833631, 20110, -72],
    [9833631, 20180, -72],
    [9833631, 20600, -214],
    [9833631, 20060, -214],
    [9833633, 20390, 91],
    [9833631, 21280, -9],
    [9833632, 21290, -187],
    [9833631, 21420, -9],
    [9833631, 21700, -183],
    [9833631, 21350, -9],
    [9833631, 21150, -186],
    [9833631, 21140, -9],
    [9833632, 21430, -187],
    [9833631, 21070, -8],
    [9833631, 21850, 14],
    [9833633, 22350, -169],
    [9833631, 22060, 18],
    [9833631, 22370, -2],
    [9833633, 22230, -1],
    [9833632, 21910, 15],
    [9833632, 21920, -31],
    [9833631, 22050, 18],
    [9833633, 22440, -2],
    [9833631, 21860, 93],
    [9833631, 21990, -27],
    [9833632, 21920, 15],
    [9833631, 21980, 16],
    [9833631, 21990, 17],
    [9833632, 21840, 14],
    [9833631, 21930, 96],
    [9833631, 22580, -2],
    [9833631, 23630, 26],
    [9833632, 23000, 27],
    [9833631, 23720, -128],
    [9833631, 23350, 26],
    [9833631, 23420, 26],
    [9833631, 23070, 26],
    [9833631, 23650, -130],
    [9833631, 23440, -203],
    [9833633, 23700, 26],
    [9833632, 23770, 26],
    [9833632, 23370, -202],
    [9833631, 23210, 26],
    [9833632, 23580, -151],
    [9833633, 23510, -199],
    [9833631, 24080, -218],
    [9833631, 24100, 67],
    [9833632, 23940, -218],
    [9833631, 24310, 67],
    [9833632, 23910, 26],
    [9833631, 24150, -93],
    [9833632, 23870, -93],
    [9833631, 24220, -93],
    [9833631, 23980, 26],
    [9833631, 23840, 26],
    [9833631, 24010, -93],
    [9833631, 24150, -218],
    [9833633, 24010, -218],
    [9833631, 24220, -218],
    [9833632, 25470, -94],
    [9833632, 25160, -99],
    [9833632, 25380, -213],
    [9833631, 25660, -214],
    [9833631, 25750, 102],
    [9833631, 25060, 62],
    [9833632, 25230, -50],
    [9833631, 25130, 110],
    [9833633, 25800, -214],
    [9833631, 25370, 48],
    [9833633, 25440, 96],
    [9833631, 24850, -85],
    [9833631, 25610, 5],
    [9833632, 24990, 13],
    [9833631, 24920, -215],
    [9833631, 25130, -215],
    [9833631, 25300, -1],
    [9833631, 25540, -44],
    [9833633, 25520, -214],
    [9833631, 24920, -36],
    [9833633, 25590, -214],
    [9833632, 25200, -215],
    [9833631, 25450, -214],
    [9833632, 25680, 53],
    [9833631, 25910, 0],
    [9833631, 26010, -215],
    [9833631, 25940, -215],
    [9833631, 26080, -215],
    [9833631, 25980, 49],
    [9833631, 25870, -215],
    [9833631, 26430, -89],
    [9833632, 26690, 52],
    [9833631, 26640, -89],
    [9833631, 26850, -220],
    [9833631, 26500, -89],
    [9833631, 26570, -220],
    [9833631, 26710, -89],
    [9833632, 26570, -89],
    [9833631, 26620, 52],
    [9833632, 26500, -220],
    [9833631, 26830, 52],
    [9833632, 26780, -220],
    [9833631, 26760, 52],
    [9833631, 27200, -89],
    [9833631, 27110, 52],
    [9833631, 27060, -220],
    [9833633, 27130, -89],
    [9833631, 26990, -220],
    [9833631, 27270, -89],
    [9833631, 26970, 52],
    [9833633, 27270, -220],
    [9833633, 27340, -220],
    [9833632, 27180, 52],
    [9833632, 26920, -220],
    [9833631, 27410, -90],
    [9833631, 27060, -89],
    [9833632, 27410, -221],
    [9833631, 26920, -89],
    [9833631, 27200, -220],
    [9833633, 27040, 52],
    [9833631, 26900, 52]
];